package mt.exam.array;

import lombok.Data;

import java.util.Comparator;

@Data
public class UserArr implements Comparable {
    private String userId;
    private String userName;
    private Integer age;

    @Override
    public int compareTo(Object o) {
        UserArr user=(UserArr) o;
        if (user.getAge()>this.age)
        {
            return -1;
        }
        if (user.getAge()<this.age){
            return 1;
        }
        return 0;
    }
}
